{% extends "shop/base.html" %}

{% load static %}

{% block title %}
    {{ category.name }}
{% endblock %}
{% block content %}

<div id="main" class="product-list">
    <h1>{% if category %}{{ category.name }}{% else %}Products{% endif %}</h1>
    <div class="images">
        {% for product in products %}
        <div class="item">
            <a href="{{ product.get_absolute_url }}">
                <img src="{% if product.image %}{{ product.image.url }}{% else %}{% static 'img/no_image.png' %}{% endif %}">
            </a>
            <a href="{{ product.get_absolute_url }}">{{ product.name }}</a>
            <br>
            ${{ product.price }}
        </div>
        {% endfor %}
    </div>
</div>

{% endblock %}
